
{extend name="layout"}
{block name="body"}
    
    <section class="wld-content">
        <div class="page_title">套餐购买</div>
        <div class="page_title_obj">
            <a class="go_back" href="{:url('index/goods/index')}">返回到服务套餐</a>
            
        </div>
        <div class="con_box layui-form" >
            <div class="goods-detail">
                <div class="goods-detail-title">
                  
                    <img src="{$goods['image_list']|default='__ROOT__/static/index/img/jcfw.png'}">
                    <div class="goods-detail-con">
                        <h4>{$goods['name']}</h4>
                    </div>
                    <div class="goods-detail-money">
                        <span class="subtract-money">-{$goods['cost']}</span>
                        <span class="subtract-money-wold">点</span>
    
                    </div>
                    
                </div>
                <div class="goods-detail-meal">
                    <p>套餐详情：</p>
                    <div class="goods-detail-list">
                        {foreach $goods['goods_detail'] as $item}
                    <p>{$item['service']['title']}<span>{$item['time']}次</span></p>
                        {/foreach}


                    </div>

                </div>
                
            </div>
            <p class="go-buy">
                确定购买
            </p>
		</div>
		<div class="con_box add_success" >
			<img src="__ROOT__/static/index/img/goodsSuccess.png" >
			<p class="title">购买成功</p>
		
		   <div class="btn">
			   <a href="{:url('index/index/index')}">返回首页</a>
			   <a href="{:url('index/goods/index')}">继续购买</a>
		   </div> 
		</div>
	</section>
<input type="hidden" name="id" value="{$goods['id']}">
{/block}

{block name="style"}
<style lang="less">
	.add_success{
		display: none;
	}
	div.con>div{
		display: inline-block;
		color: #9c9cae;
	}
	.con span{
		display: inline-block;
		padding: 0 5px;
	}
	.con a{
		float: right;
		padding-left: 5px;
		color: #61cad7;
		text-decoration: underline;
	}
	.con a:hover{
		
		color: #42c2d2;
		
	}

	.con_box{
		padding: 34px 45px 100px 45px;
	}

	
    .add_success img{
        padding-bottom: 25px;
    }
    .add_success p.title{
        padding-bottom: 0;
    }
    .add_success .btn{
        padding-top:44px;
    }

	
</style>
{/block}
{block name="script"}
<script>
    $(function () {
        var id = $("[name='id']").val();
        $(".go-buy").click(function(){
            $.form.load('{:url("index/goods/detail")}', {id : id}, "post", function (res) {
                if (res.code === 1) {
                        $(".layui-form").hide();
                        $(".add_success").show();
                } else {
                    $.msg.alert(res.info,"购买失败",'del')

                }
                return false;
            })
        
            
        })
    })

   
 

</script>
{/block}




